package com.weixing.mall.provider.model.vo.report.customer;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.base.enums.WhetherEnum;
import com.weixing.mall.core.enums.OrderSysTagEnum;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.model.enums.*;
import com.weixing.mall.provider.support.excel.EnumConverter.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

/**
 * @author Small
 * @since 2020-05-07
 */
@Data
@ApiModel(value="SeckillReport25zDetailVo", description="2.5折秒杀活动报表-详情")
@ContentRowHeight(40)
public class SeckillReport25zDetailVo {
    @ApiModelProperty(value = "订单Id")
    @ExcelIgnore
    private Long id;
    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String goodsImg;
    @ApiModelProperty(value = "客服")
    @ExcelProperty("客服")
    private String customerName;
    @ApiModelProperty(value = "经销商")
    @ExcelProperty("经销商")
    private String distributorName;

    @ApiModelProperty(value = "一级代理")
    @ExcelProperty("一级代理")
    private String level1stName;
    @ApiModelProperty(value = "二级代理")
    @ExcelProperty("二级代理")
    private String level2ndName;
    @ApiModelProperty(value = "三级代理")
    @ExcelProperty("三级代理")
    private String level3rdName;
    @ApiModelProperty(value = "四级代理")
    @ExcelIgnore
    @ExcelProperty("四级代理")
    private String level4thName;

    @ApiModelProperty(value = "支付流水号")
    @ExcelProperty("支付流水号")
    private String outTradeNo;
    @ApiModelProperty(value = "订单金额")
    @ExcelProperty("订单金额")
    private BigDecimal orderPrice;
    @ApiModelProperty(value = "订单状态（1待付款;4已取消;7已付款/待审核;10,审核中;13;审核完成/待封单;16已封单;19待发货;22已发货;25已完成;28售后中）")
    @ExcelProperty(value = "订单状态",converter = OrderStatusConverter.class)
    private OrderStateEnum orderStatus;
    @ApiModelProperty(value = "订单标签")
    @ExcelProperty(value = "订单标签",converter = OrderSysTagConverter.class)
    private OrderSysTagEnum sysTag;
    @ApiModelProperty(value = "经销商返还款")
    @ExcelProperty("经销商返还款")
    private String distributorRebate;
    @ApiModelProperty(value = "一级代理返还款")
    @ExcelProperty("一级代理返还款")
    private String level1stRebate;
    @ApiModelProperty(value = "二级代理返还款")
    @ExcelProperty("二级代理返还款")
    private String level2ndRebate;
    @ApiModelProperty(value = "三级代理返还款")
    @ExcelProperty("三级代理返还款")
    private String level3rdRebate;
    @ApiModelProperty(value = "四级代理返还款")
    @ExcelIgnore
    @ExcelProperty("四级代理返还款")
    private String level4thRebate;


    @ExcelProperty("图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

    @ApiModelProperty(value = "货号")
    @ExcelProperty("货号")
    private String goodsSn;
    @ApiModelProperty(value = "款号")
    @ExcelProperty("款号")
    private String styleNo;
    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;
    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;
    @ApiModelProperty(value = "订单号")
    @ExcelProperty("订单号")
    private String orderSn;
    @ApiModelProperty(value = "吊牌价")
    @ExcelProperty("吊牌价")
    private BigDecimal marketPrice;
    @ApiModelProperty(value = "收货人")
    @ExcelProperty("收货人")
    private String contactUser;
    @ApiModelProperty(value = "收货人手机号")
    @ExcelProperty("收货人手机号")
    private String contactPhone;
    @ApiModelProperty(value = "收货地址")
    @ExcelProperty("收货地址")
    private String address;
    @ApiModelProperty(value = "是否支付")
    @ExcelProperty(value = "是否支付",converter = WhetherEnumConverter.class)
    private WhetherEnum isPay;
    @ApiModelProperty(value = "是否换货")
    @ExcelProperty(value = "是否换货",converter = WhetherEnumConverter.class)
    private WhetherEnum afterSaleTag;
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "活动名称")
    @ExcelProperty("活动名称")
    private String actName;
    @ApiModelProperty(value = "下单人")
    @ExcelProperty("下单人")
    private String buyer;
    @ApiModelProperty(value = "发货员")
    @ExcelProperty("发货员")
    private String shipperName;
    @ApiModelProperty(value = "快递公司")
    @ExcelProperty("快递公司")
    private String expressName;
    @ApiModelProperty(value = "快递单号")
    @ExcelProperty("快递公司")
    private String expressSn;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "下单时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("下单时间")
    private Date createdTime;
    @ApiModelProperty(value = "客服审核时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("客服审核时间")
    private Date auditTime;
    @ApiModelProperty(value = "发货时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("发货时间")
    private Date shipTime;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("更新时间")
    private Date updatedTime;

}
